package vn.wallet.app.helper.exceptions;

import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerFactory;

public class MyExceptionHandlerFactory extends ExceptionHandlerFactory {

	private final ExceptionHandlerFactory base;

	private MyExceptionHandler cached;

	public MyExceptionHandlerFactory(ExceptionHandlerFactory base) {
		this.base = base;
	}

	@Override
	public ExceptionHandler getExceptionHandler() {
		if (cached == null) {
			cached = new MyExceptionHandler(base.getExceptionHandler());
		}

		return cached;
	}
}
